﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlTaskList.ascx.cs" Inherits="Ctl_ctlTaskList" %>
<%@ Register src="ctlTaskEditor.ascx" tagname="ctltaskeditor" tagprefix="uc1" %>
<style type="text/css">

</style>


<asp:Panel ID=pnlHead runat ="server"  >
<table cellpadding ="5px" cellspacing ="0" width ="100%" >
<tr id=Tr1  runat ="server"   style ="height:15px" >
                    <td class ="grd_td_item">       
                          <table width ="100%" cellpadding ="2px" cellspacing ="0">            
                            <tr >
                            <td   style ="width :50px"  class ="grd_td_head" >                                                    
                                <asp:UpdateProgress ID="UpdateProgress2" runat="server"  >
                                <ProgressTemplate >
                                    <asp:Image ID=Image11 ImageUrl="~/images/loadinfo.net.gif" runat="server" />
                                </ProgressTemplate>
                                </asp:UpdateProgress>
                                &nbsp
                            </td>                      
                            <td  style="text-align :left" class ="grd_td_head" >                
                                    <asp:LinkButton ID=Name runat="server" OnClick ="lvSort" CommandArgument ="s_TaskContent" >Содержание</asp:LinkButton>
                                    <asp:Label ID=Label1 runat="server"  CssClass =<%# GetHeadCss("s_TaskContent") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>
                            <td  style="text-align :left;width :200px;"  class ="grd_td_head">                
                                <asp:LinkButton ID=LinkButton1 runat="server" OnClick ="lvSort" CommandArgument ="s_Client" >Клиент</asp:LinkButton>
                                   <asp:Label ID=Label2 runat="server"  CssClass =<%# GetHeadCss("s_Client") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>
                            <td  style="text-align :left;width :150px;"  class ="grd_td_head">                
                                <asp:LinkButton ID=LinkButton2 runat="server" OnClick ="lvSort" CommandArgument ="s_EmployeerShort" >Исполнитель</asp:LinkButton>
                                   <asp:Label ID=Label3 runat="server"  CssClass =<%# GetHeadCss("s_EmployeerShort") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>
                            <td  style ="width :100px;text-align :left" class ="grd_td_head">                    
                                <asp:LinkButton ID=LinkButton3 runat="server" OnClick ="lvSort" CommandArgument ="s_Type" >Категория</asp:LinkButton>
                                   <asp:Label ID=Label4 runat="server"  CssClass =<%# GetHeadCss("s_Type") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>            
                            <td  style ="width :100px" class ="grd_td_head">
                               <asp:LinkButton ID=LinkButton4 runat="server" OnClick ="lvSort" CommandArgument ="dtFinish" >Окончание</asp:LinkButton>
                                   <asp:Label ID=Label5 runat="server"  CssClass =<%# GetHeadCss("dtFinish") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>                        
                            <td style ="width :100px"  class ="grd_td_head">                                                            
                                    <asp:LinkButton ID=LinkButton5 runat="server" OnClick ="lvSort" CommandArgument ="s_Closed" >Статус</asp:LinkButton>
                                 <asp:Label ID=Label6 runat="server"  CssClass =<%# GetHeadCss("s_Closed") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                            </td>            
                            <td style="width:25px; text-align :right " class ="grd_td_head" >
                                &nbsp
                            </td>            
                            </tr>
                  </table>
                                                                     
                    </td>
                    </tr>
</table> 
</asp:Panel>

<table cellpadding ="0" cellspacing ="0" width ="100%" >
<asp:ListView ID="lvTask" runat="server" onitemcommand="ItemCommand" 
                        onitemediting="ItemEditing" onitemupdating="ItemUpdating" 
                        onpagepropertieschanged="lvTask_PagePropertiesChanged" 
                        onselectedindexchanged="lvTask_SelectedIndexChanged">                 
                 <LayoutTemplate >                    
                    <tr runat="server" id="itemPlaceholder" ></tr>                                                
                 </LayoutTemplate>                 
                 <ItemTemplate >
                 <tr >
                 <td  class =<%#  (string)Eval("RowCss")  %>  onmouseover =<%# Get_OnMouseover((string)Eval("s_Closed")) %>  onmouseout ="GrdItemOnMouseOut(this);">                                   
                 <table width ="100%" cellpadding ="2px" cellspacing ="0">            
                            <tr >
                            <td   style ="width :50px"  >                                                    
                                <asp:ImageButton ID=ImageButton1 runat="server" CommandName ="Edit" ImageUrl ="~/images/grd_plus.gif" />
                            </td>                      
                            <td  style="text-align :left" >                
                                <%# (string)Eval("s_TaskContent")%>
                            </td>
                            <td  style="text-align :left;width :200px;" >                
                                <%# ((string)Eval("s_Client")==string.Empty?"&nbsp":(string)Eval("s_Client"))  %>
                            </td>
                            <td  style="text-align :left;width :150px;"  >                
                                <%# ((string)Eval("s_Employeer") == string.Empty ? "&nbsp" : (string)Eval("s_Employeer"))%>
                            </td>
                            <td  style ="width :100px;text-align :left" >                    
                                <%# ((string)Eval("s_Type")==string.Empty?"&nbsp":(string)Eval("s_Type"))  %>
                            </td>            
                            <td  style ="width :100px" >
                               <%# ((string)Eval("s_dtFinish") == String.Empty ? "&nbsp" : ((DateTime)Eval("Task.dtFinish")).ToString ("dd MMMM"))%>
                            </td>                        
                            <td style ="width :100px"  >                                                                                                
                                    <%# (string)Eval("s_Closed") %>
                            </td>            
                            <td style="width:25px; text-align :right " >
                                &nbsp
                            </td>            
                            </tr>
                  </table> 
                  </td> 
                  </tr> 
                 </ItemTemplate>    
                 <EditItemTemplate >
                    <tr id=Tr1  runat ="server"   style ="height:15px" >
                    <td class ="grd_td_item">  
                    <div style = "width:100%"  class ="EditRowBackGround" >                                                                     
                        <asp:HiddenField ID=hfTaskID  Value =<%# (string)Eval("Task.ID") %> runat="server" />
                        <uc1:ctlTaskEditor TaskID =<%# (string)Eval("Task.ID") %>    ID="ctlTaskEditor1" runat="server" />                                        
                        
                    </div>                                         
                    </td> 
                    </tr> 
                 </EditItemTemplate >
                 
                 <EmptyDataTemplate >
                 <tr>
                 <td style ="text-align :center ">
                    Задач нет                    
                 </td> 
                 </tr>
                 </EmptyDataTemplate>
                 
                
                </asp:ListView>
</table>

<asp:DataPager runat="server" ID="DataPager"  EnableViewState ="true"  PagedControlID = "lvTask" PageSize=<%# GlobalConstants.Def_RecordOnScreen %>  >
        <Fields>
          <asp:NumericPagerField  ButtonType ="Link"                       
              ButtonCount="5"
               PreviousPageText="<--"
               NextPageText="-->" />
               <asp:NextPreviousPagerField ButtonType="Link"
                ShowFirstPageButton="true"
                ShowPreviousPageButton="true"
                ShowLastPageButton="true" 
                ShowNextPageButton ="true"/>
        </Fields>
   </asp:DataPager>



    

